package com.gitee.loyo.interfaces

import junit.framework.TestCase
import com.gitee.loyo.TUser
import com.gitee.loyo.interfaces.impl.InsertSQL
import org.junit.Test

class InsertSQLTest : TestCase(){

    @Test
    fun test(){
        val tUser = TUser(1L, "sam", 1, null)
        val insertSQL = InsertSQL(tUser)
        assertEquals("insert into t_user(user_id, user_name, sex)values(?, ?, ?)", insertSQL.getSQL())
        assertEquals(3, insertSQL.getParameters().size)
        assertEquals(tUser.userId, insertSQL.getParameters()[0])
        assertEquals(tUser.userName, insertSQL.getParameters()[1])
        assertEquals(tUser.sex, insertSQL.getParameters()[2])
    }
}